Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[12.0][FIX] base_jsonify: In odoo 12, Date and Datetime fields values are d… #1711

Merged
merged 1 commit into from
Oct 30, 2019

Conversation

lmignon
Copy link
Contributor

@lmignon lmignon commented Oct 30, 2019

…atetime objects

Convert fields.Date and fields.Datetime values to string when serializing to json

…atetime object

Convert fields.Date and fields.Datetime values to string when serializing to json
Copy link
Contributor

@acsonefho acsonefho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM

@lmignon
Copy link
Contributor Author

lmignon commented Oct 30, 2019

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 12.0-ocabot-merge-pr-1711-by-lmignon-bump-patch, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Oct 30, 2019
Signed-off-by lmignon
@lmignon lmignon changed the title [FIX] base_jsonify: In odoo 12, Date and Datetime fields values are d… [12.0][FIX] base_jsonify: In odoo 12, Date and Datetime fields values are d… Oct 30, 2019
@OCA-git-bot OCA-git-bot merged commit 560ba5b into OCA:12.0 Oct 30, 2019
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at feae1f6. Thanks a lot for contributing to OCA. ❤️

@OCA-git-bot OCA-git-bot changed the title [12.0][FIX] base_jsonify: In odoo 12, Date and Datetime fields values are d… [12.0][FIX] base_jsonify: In odoo 12, Date and Datetime fields values are d… Oct 30, 2019
@lmignon lmignon deleted the 12.0-fix-datetime-base-jsonify branch October 30, 2019 11:04
elif field_type == "date":
value = fields.Date.to_string(value)
elif field_type == "datetime":
value = fields.Datetime.to_string(value)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to be compliant with ISO 8601 here.
Date is ok, but date_time defined here https://github.com/odoo/odoo/blob/12.0/odoo/tools/misc.py#L568
is with a space as separator between dates and time. Plus it's lacking timezone.

https://www.w3.org/TR/NOTE-datetime

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lmignon have you seen this comment? Sounds important to me too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sbidoul Yes I see it, I'll provide a new PR to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants